﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace Learn.Service.Interface
{
    public interface I_Base_EFCore<T>where T : class,new()
    {
        T Find(params object[] keys);
        void Add(T t);
        void AddRange(IEnumerable<T> ie);
        void update(T t);

        void updateRange(IEnumerable<T> ie);    

        void Delete(T t);

        void DeleteRange(IEnumerable<T> ie);
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        int SaveChanges();


        IQueryable<T> QueryAll(Expression<Func<T, bool>> where = null);

        IQueryable<T> QueryAll<type>(bool isAsc, Expression<Func<T, type>> order, Expression<Func<T, bool>> where = null);

        IQueryable<T> QueryAll<type>(out int total, int skip, int limit, bool isAsc, Expression<Func<T, type>> order, Expression<Func<T, bool>> where = null);

    }
}
